#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    int findSpecialInteger(vector<int>& arr) {
        int count = arr.size() * 0.25;
        int same = 0;
        for (int i = 1; i < arr.size(); ++i)
        {
            if (arr[i] == arr[i - 1])
            {
                ++same;
                if (same >= count)
                {
                    return arr[i];
                }
            }
            else
            {
                same = 0;
            }
        }

        return arr[0];
    }
};